cmake_minimum_required(VERSION 3.10)
project(BertClassificationV2)
set(CMAKE_CXX_STANDARD 14)

add_compile_options(-std=c++11 -fstack-protector-all -g -fPIC -Wl,-z,relro,-z,now,-z -pie -Wall)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0 -Dgoogle=mindxsdk_private)
include_directories(./BertClassification)
file(GLOB_RECURSE BertClassification ${PROJECT_SOURCE_DIR}/BertClassification/*cpp)

set(MX_SDK_HOME "$ENV{MX_SDK_HOME}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/")
include_directories(
        ${MX_SDK_HOME}/include
        ${MX_SDK_HOME}/opensource/include
        ${MX_SDK_HOME}/opensource/include/opencv4
        /usr/local/Ascend/ascend-toolkit/latest/runtime/include
)

link_directories(
        ${MX_SDK_HOME}/lib
        ${MX_SDK_HOME}/opensource/lib
        ${MX_SDK_HOME}/lib/modelpostprocessors
        /usr/local/Ascend/ascend-toolkit/latest/runtime/lib64/
        /usr/local/Ascend/ascend-toolkit/latest/runtime/lib64/stub/
        /usr/local/Ascend/ascend-toolkit/latest/atc/lib64
)

add_executable(BertClassificationV2 main.cpp ${BertClassification})

target_link_libraries(BertClassificationV2
        ascendcl
        glog
        mxbase
        cpprest
        opencv_world
        )